<%@page language="java" contentType="text/html;charset=UTF-8"%>
<%@include file="/WEB-INF/core/common/top.jsp" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<link type="text/css" rel="stylesheet" href="${ctx}/core/styles/validatorAuto.css" />
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>

<script language="javascript">
<!--
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"form0",onerror:function(msg){showMessage(msg);},onsuccess:function(){
			$("#submitButton").attr('disabled',true);
			$("#info").attr("style","display:''");
			}});
		$("#filename").formValidator().inputValidator({min:1,onerror:"<s:text name='select.epg.file'/>"});
	});	

/**
	function testFileExists(){
		var _fileDir=$("#epgFile").attr("value");
		var url="${ctx}/epgManage/epgImport.action?act=testFileExists";
		var params={fileDir:_fileDir};
		$.post(url,params,callback,"json");
		return false;
	}
	
	function callback(data){      
       if(data.msg=="true"){
       		form0.submit();
       }else{
       		showMessage("<s:text name='file.not.exists'/>");
       		$("#submitButton").attr('disabled',false);
       }
    }
*/
   function epgImport(){
   		location="${ctx}/epgManage/epgImport.action?systime="+(new Date()).getTime();
   }
   
   function epgManage(){
   		location="${ctx}/epgManage/epgManage.action?systime="+(new Date()).getTime();
   }  
//-->
</script>

<body style="overflow-x:hidden;overflow-y:auto;" >

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
   <tr>
    <td width="8"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" valign="middle" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="epg.import"/></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
  </tr>

  <tr>
    <td colspan="4" class="biaoge">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr><td height="10px"></td></tr>
        <tr>
          <td valign="top">
		  <table width="100%" border="0" align="center" cellspacing="0">
          <tr>
            <td class="tabulation">

<form method="post" action="${ctx}/epgManage/epgImport.action" name="form0" id="form0" enctype="multipart/form-data">
<s:hidden name="act" value="doImport"/>
			<table bordercolor=#ffffff cellspacing=1 cellpadding=0 width="100%" border=0>
               <tr bgcolor="#DDE4EA" height=27>
                <td colspan="2" align="right">
					<s:text name="epg.template"/>&nbsp;<a href="${ctx}/templates/download.jsp?fileid=EPG.xml">EPG.xml</a>&nbsp;&nbsp;
				</td>
				 </tr>			  
			    <tr bgcolor="#DDE4EA" height=27>
							<td align="left"><span><s:text name="epg.file"/>&nbsp;<font color="red">*</font></span></td>
							<td bgcolor=#dde4ea >
                					<div style="padding:0px;margin:0px;padding-left:6px;padding-top:1px;">
                								<ul style="padding:0px;margin:0px;list-style-type:none;">
                									<li style="float:left;display:inline;height:20px;">
                									<input name="filename" type="text" size="65" value="" id="filename" readonly>
                									</li>
                									<li style="float:left;display:inline;padding-left:10px;padding-top:2px;height:22px;overflow:hidden;"> 
			                							<div id="fakeButton" class="btn" style="width: 75px; height: 20px;padding-top:1px;"><s:text name="button.file"/></div>
														<input name="epgFile" type="file" style="width: 67px; height: 20px;  filter: alpha(opacity =   0);  position: relative; top: -20px;left:-6px" onchange="this.form.filename.value=this.value;">
													</li>
												</ul>
									</div> 
							</td>							 
			     </tr>
			  <tr align=left height=37>
                <td colspan="2" align="left">
					<input name="button22" id="submitButton" type="submit" class="btn" value=" <s:text name='button.import'/> "/>
				</td>
              </tr>
              <tr><td colspan="2" height="10px"><span id="info" style="display:none"><s:text name="epg.import.wait"/></span></td></tr>
            </table>
            </form>
            </td>
          </tr>
             </table>

            </td>
          </tr>
    </table>
</body>
